import java.text.SimpleDateFormat
import java.util.{Calendar, Date}

object CalDate {
  def main(args: Array[String]): Unit = {

    val s1: String = "2016-05-26 05:29:32"
    val sf: SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS")
    val d1: Date = sf.parse(s1)
    val d2: Date = new Date()

    val cal = Calendar.getInstance()
    cal.setTime(d1)
    cal.add(Calendar.DAY_OF_MONTH,1)//给d1的日期加上一个月
    val res: Date = cal.getTime()
    println(d2.after(d1))//返回boolean值，判断d2的日期是否在d1之后

  }
}
